def create_Rect_MainRF_Position
      model = Sketchup.active_model
      prompts = ["b边长度mm", "H边长度mm","主筋数量","主筋直径",
        "角筋数量","角筋直径","b边筋数量","b边筋直径","H边筋数量",
        "H边筋直径","保护层","箍筋直径","首桩高1低0"]
  		defaults = ["750", "700","28","25","","","","","","","25","10","0"]
  		input = UI.inputbox(prompts, defaults, "创建矩形柱")

        ###########定义传参变量##########
     b = input[0].to_f.mm
     h = input[1].to_f.mm
     mainRFnum = input[2].to_i
     mainRFdim = input[3].to_f.mm
     arcRFnum = input[4].to_i
     arcRFdim = input[5].to_f.mm
     b_RFnum = input[6].to_i
     b_RFdim = input[7].to_f.mm
     h_RFnum = input[8].to_i
     h_RFdim = input[9].to_f.mm
     layer = input[10].to_f.mm
     stirrupDim = input[11].to_f.mm
     hOrL = input[12].to_i


     group = model.active_entities.add_group
     entities = group.entities                     #绘制柱边框、箍边框
       points = [
           Geom::Point3d.new(0, 0, 0),
           Geom::Point3d.new(b, 0, 0),
           Geom::Point3d.new(b, h, 0),
           Geom::Point3d.new(0, h, 0),
           Geom::Point3d.new(0, 0, 0)
       ]
       entities.add_line points

       points = [
        Geom::Point3d.new(layer, layer, 0),
        Geom::Point3d.new(b-layer, layer, 0),
        Geom::Point3d.new(b-layer, h-layer, 0),
        Geom::Point3d.new(layer, h-layer, 0),
        Geom::Point3d.new(layer, layer, 0)
        ]
        entities.add_line points

        stDnei = layer+stirrupDim
        points = [
            Geom::Point3d.new(stDnei, stDnei, 0),
            Geom::Point3d.new(b-stDnei, stDnei, 0),
            Geom::Point3d.new(b-stDnei, h-stDnei, 0),
            Geom::Point3d.new(stDnei, h-stDnei, 0),
            Geom::Point3d.new(stDnei, stDnei, 0)
            ]
            entities.add_line points

#puts mainRFnum
    if mainRFnum > 0 && mainRFnum%4 == 0            #如果全部主筋数量存在，就按全部主筋布筋
        
        arcRFpos = stDnei+mainRFdim/2              #角筋定位计算
        points = [
        Geom::Point3d.new(arcRFpos, arcRFpos, 0),
        Geom::Point3d.new(b-arcRFpos, arcRFpos, 0),
        Geom::Point3d.new(b-arcRFpos, h-arcRFpos, 0),
        Geom::Point3d.new(arcRFpos, h-arcRFpos, 0)
        ]
        vector = Z_AXIS
        #edges = entities.add_circle(points[0], vector, mainRFdim/2)

        (0..3).each do |i|                          #绘制角筋
         edges = entities.add_circle(points[i], vector, mainRFdim/2)
         if hOrL == 0                               #角筋高低桩判断
            #puts (mainRFnum%4)%2 != 0
            if (mainRFnum/4)%2 != 0
                if i%2 != 0
                    face = entities.add_face(edges)
                end
            end
         else
            if (mainRFnum/4)%2 != 0
                if i%2 == 0
                    face = entities.add_face(edges)
                end
            else
                face = entities.add_face(edges)
            end
         end
        end

        b_mainRFInterval = (b - arcRFpos*2)/(mainRFnum/4)   #边筋间距计算
        h_mainRFInterval = (h - arcRFpos*2)/(mainRFnum/4)
        b_RFnum = h_RFnum = mainRFnum/4-1                   #边筋数量计算

        (0..b_RFnum-1).each do |i|                 #绘制b边筋

            point = Geom::Point3d.new(arcRFpos+b_mainRFInterval*(i+1), h-arcRFpos, 0)
            edges = entities.add_circle(point, vector, mainRFdim/2)
            
            if b_RFnum%2 != 0
                if hOrL == 0 && i%2 == 0 || hOrL != 0 && i%2 != 0
                    face = entities.add_face(edges)
                end
            else
                if hOrL == 0 && i%2 != 0 || hOrL != 0 && i%2 == 0
                    face = entities.add_face(edges)
                end
            end 


            point = Geom::Point3d.new(arcRFpos+b_mainRFInterval*(i+1), arcRFpos, 0)
            edges = entities.add_circle(point, vector, mainRFdim/2)
            if hOrL == 0 && i%2 == 0 || hOrL != 0 && i%2 != 0
                face = entities.add_face(edges)
            end
            #puts b_mainRFInterval
        end

        (0..h_RFnum-1).each do |i|

            point = Geom::Point3d.new(arcRFpos, arcRFpos+h_mainRFInterval*(i+1), 0)
            edges = entities.add_circle(point, vector, mainRFdim/2)
            if hOrL == 0 && i%2 == 0 || hOrL != 0 && i%2 != 0
                face = entities.add_face(edges)
            end
                      
            point = Geom::Point3d.new(b-arcRFpos, arcRFpos+h_mainRFInterval*(i+1), 0)
            edges = entities.add_circle(point, vector, mainRFdim/2)
            
            if h_RFnum%2 != 0
                if hOrL == 0 && i%2 == 0 || hOrL != 0 && i%2 != 0
                    face = entities.add_face(edges)
                end
            else
                if hOrL == 0 && i%2 != 0 || hOrL != 0 && i%2 == 0
                    face = entities.add_face(edges)
                end
            end 
            #puts b_mainRFInterval
        end


    else        #如果全部主筋数量不存在，就按角筋与边筋布筋




    end

end


